Repository navigation
Keep the Google Advertising ID per SDK instance - #61
Closed
jrosendahl-opt wants to merge 1 commit into
Closed
jrosendahl-opt wants to merge 1 commit into
jrosendahl-opt wants to merge 1 commit into
Conversation
GoogleAdIdManager kept the ad ID and the Limit Ad Tracking flag in a companion object, shared by every OptableSDK instance. An instance created with skipAdvertisingIdDetection = true, for example after the user withdrew consent, still sent the GAID an earlier instance had read, until the process restarted. Keep both per instance. Every instance already fetched on creation, so the shared state saved nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
GoogleAdIdManagerkept the ad ID and the Limit Ad Tracking flag in acompanion object, shared by everyOptableSDKinstance. An instance created withskipAdvertisingIdDetection = true, for example after the user withdrew consent, still sent the GAID an earlier instance had read, until the process restarted. A Limit Ad Tracking value read by one instance also overwrote every other instance's.What Changed
GoogleAdIdManagerkeepsadIdandlimitAdTrackingper instance instead of in acompanion object. Every instance already fetched on creation, so the shared state saved nothing.GoogleAdIdManagerTestdrops the reflection reset of the companion fields and adds tests that a skip instance returns no GAID after another instance read one, and that one instance's Limit Ad Tracking value doesn't affect another.How to Test
./gradlew testpasses (162 tests locally)Notes
#60 documents the fixed behaviour and should merge after this and the GAID timeout fix.
🤖 Generated with Claude Code